

	<script type="text/javascript"><!--
var selected;
var form = "";
var submitted = false;
var error = false;
var error_message = "";

function selectRowEffect(object, buttonSelect) {
  if (!selected) {
    if (document.getElementById) {
      selected = document.getElementById('defaultSelected');
    } else {
      selected = document.all['defaultSelected'];
    }
  }

  if (selected) selected.className = 'moduleRow';
  object.className = 'moduleRowSelected';
  selected = object;

// one button is not an array
  if (document.checkout_address.shipping[0]) {
    document.checkout_address.shipping[buttonSelect].checked=true;
  } else {
    document.checkout_address.shipping.checked=true;
  }
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function check_form() {
  if (submitted == true) {
    alert("This form has already been submitted. Please press Ok and wait for this process to be completed.");
    return false;
  }

  error = false;
  form = document.checkout_address; 
    submitted = true;
	form.actionForm.value = 'submit'; 	
	form.submit();
    return true;
 
}

//--></script>
	<h1>Delivery Information</h1>
	<form name="checkout_address"  id="checkout_address"
		action="<{$APPLICATION_URL}>/<{$ownerName}>Product/checkoutShipping"
		method="post">
		<div class="contentContainer">
			<h2>Shipping Address</h2>
			<div class="contentText">
				<{if $shippingAddress}>
				<div class="ui-widget infoBoxContainer" style="float: right;">
					<div class="ui-widget-header infoBoxHeading">Shipping Address:</div>
					<div class="ui-widget-content infoBoxContents">
						<{$shippingAddress->getName()}><br> <{$shippingAddress->street}><br> <{$shippingAddress->getState()}>, <{$shippingAddress->city}>    <{$shippingAddress->postCode}><br> <{$shippingAddress->getCountry()}> 
					</div>
				</div>
				<{/if}>
				Please choose from your address book where you would like the items
				to be delivered to.<br />
				<br />
				<span class="tdbLink"><a id="tdb5"
					href="<{$APPLICATION_URL}>/<{$ownerName}>MyAccount/addAddress/type/ship">Change
						Address</a>
				</span>
				<script type="text/javascript">$("#tdb5").button({icons:{primary:"ui-icon-home"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script>
			</div>

			<div style="clear: both;"></div>
			<h2>Shipping Method</h2>
			
			<!--  <div class="contentText">This is currently the only shipping method
				available to use on this order.</div>-->
			<div class="contentText">
				<div style="font-size: 14px; padding:10px;"><label for="shipmethod">Shipping Name</label>
					<select name="shipmethod" id="shipmethod" onchange="shipChange(this.value);">
						<{foreach item=item from=$listItem}>
						<option value="<{$item->id}>"><{$item->name}></option>
						<{/foreach}>  
					</select>
				&nbsp;&nbsp;&nbsp;
				<label for="shipprice">Shipping Fee</label>
					<select name="shipprice" id="shipprice" onchange="shipChange(this.value);">
						<{foreach item=item from=$listItem}>
						<option value="<{$item->id}>"><{$item->fee|string_format:"%.2f"}></option>
						<{/foreach}>  
					</select>
				</div>				
			</div>
			<h2>Add Comments About Your Order</h2>

			<div class="contentText">
				<textarea name="comment" cols="60" rows="5"><{$comment}></textarea>
			</div>
			<input type="hidden" id="actionForm" name="actionForm" value=""/>
			
	</form>

</div>
<div class="contentText">

	<div style="float: right;">
		<span class="tdbLink"><button id="tdb6" type="submit" onclick="return check_form();">Continue</button>
		</span>
		<script type="text/javascript">$("#tdb6").button({icons:{primary:"ui-icon-triangle-1-e"}}).addClass("ui-priority-primary").parent().removeClass("tdbLink");</script>
	</div>
</div>
<script type="text/javascript">

 function shipChange(shipid)
 {
	 
	 var form = document.getElementById('checkout_address');
	 if(form)
	 {
		
		form.shipmethod.value=shipid;
		form.shipprice.value=shipid;
	 }
 }
</script> 
